home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / Chip 11-96.iso / workshop / howto / kernel < prev    next >
Text File  |  1996-09-04  |  55KB  |  1,218 lines

  1.   The Linux Kernel HOWTO
  2.   Brian Ward, bri@blah.math.tu-graz.ac.at
  3.   v0.75, 1 August 1996
  4.  
  5.   This is a detailed guide to kernel configuration, compilation, and
  6.   upgrades.
  7.  
  8.   1.  Introduction
  9.  
  10.   This is release 0.75 of the Kernel-HOWTO. Should you read this
  11.   document?  Well, see if you've got any of the following symptoms:
  12.  
  13.   ╖  ``Arg! This wizzo-46.5.6 package says it needs kernel release
  14.      1.8.193 and I still only have release 1.0.9!''
  15.  
  16.   ╖  There's a device driver in one of the newer kernels that you just
  17.      gotta have
  18.  
  19.   ╖  You really have no idea at all how to compile a kernel
  20.  
  21.   ╖  ``Is this stuff in the README really the whole story?''
  22.  
  23.   ╖  You came, you tried, it didn't work
  24.  
  25.   ╖  You know how to compile and install a kernel, and people seem to
  26.      know this. Therefore, they keep whining to you to help them install
  27.      their kernels.
  28.  
  29.   1.1.  Read this first! (I mean it)
  30.  
  31.   Some of the examples in this document assume that you have GNU tar,
  32.   find, and xargs. These are quite standard; this should not cause
  33.   problems. It is also assumed that you know your system's filesystem
  34.   structure; if you don't, it is critical that you keep a written copy
  35.   of the mount command's output during normal system operation (or a
  36.   listing of /etc/fstab, if you can read it). This information is
  37.   important, and does not change unless you repartition your disk, add a
  38.   new one, reinstall your system, or something similar.
  39.  
  40.   The latest ``production'' kernel version at the time of this writing
  41.   was 2.0.10, meaning that the references and examples correspond to
  42.   that release. Even though I try to make this document as version-
  43.   independent as possible, the kernel is constantly under development,
  44.   so if you get a newer release, it will inevitably have some
  45.   differences. Again, this should not cause major problems, but it may
  46.   create some confusion.
  47.  
  48.   There are two versions of the linux kernel source, ``production'' and
  49.   ``development.'' Production releases begin with 1.0.x and are
  50.   currently the even-numbered releases; 1.0.x was production, 1.2.x is
  51.   production, as well as 2.0.x. These kernels are considered to be the
  52.   most stable, bug-free versions available at the time of release. The
  53.   development kernels (1.1.x, 1.3.x, etc) are meant as testing kernels,
  54.   for people willing to test out new and possibly very buggy kernels.
  55.   You have been warned.
  56.  
  57.   1.2.  A word on style
  58.  
  59.   Text that looks like this is either something that appears on your
  60.   screen, a filename, or something that can be directly typed in, such
  61.   as a command, or options to a command (if you're looking at a plain-
  62.   text file, it doesn't look any different). Commands and other input
  63.   are frequently quoted (with ` '), which causes the following classic
  64.   punctuation problem: if such an item appears at the end of a sentence
  65.   in quotes, people often type a `.' along with the command, because the
  66.   American quoting style says to put the period inside of the quotation
  67.   marks. Even though common sense (and unfortunately, this assumes that
  68.   the one with the ``common sense'' is used to the so-called American
  69.   style of quotation) should tell one to strip off the punctuation
  70.   first, many people simply do not remember, so I will place it outside
  71.   the quotation marks in such cases. In other words, when indicating
  72.   that you should type ``make config'' I would write `make config', not
  73.   `make config.'
  74.  
  75.   2.  Important questions and their answers
  76.  
  77.   2.1.  What does the kernel do, anyway?
  78.  
  79.   The Unix kernel acts as a mediator for your programs and your
  80.   hardware.  First, it does (or arranges for) the memory management for
  81.   all of the running programs (processes), and makes sure that they all
  82.   get a fair (or unfair, if you please) share of the processor's cycles.
  83.   In addition, it provides a nice, fairly portable interface for
  84.   programs to talk to your hardware.
  85.  
  86.   There is certainly more to the kernel's operation than this, but these
  87.   basic functions are the most important to know.
  88.  
  89.   2.2.  Why would I want to upgrade my kernel?
  90.  
  91.   Newer kernels generally offer the ability to talk to more types of
  92.   hardware (that is, they have more device drivers), they can have
  93.   better process management, they can run faster than the older
  94.   versions, they could be more stable than the older versions, and they
  95.   fix silly bugs in the older versions. Most people upgrade kernels
  96.   because they want the device drivers and the bug-fixes.
  97.  
  98.   2.3.  What kind of hardware do the newer kernels support?
  99.  
  100.   See the Hardware-HOWTO. Alternatively, you can look at the `config.in'
  101.   file in the linux source, or just find out when you try `make config'.
  102.   This shows you all hardware supported by the standard kernel
  103.   distribution, but not everything that linux supports; many common
  104.   device drivers (such as the PCMCIA drivers and some tape drivers) are
  105.   loadable modules maintained and distributed separately.
  106.  
  107.   2.4.  What version of gcc and libc do I need?
  108.  
  109.   Linus recommends a version of gcc in the README file included with the
  110.   linux source. If you don't have this version, the documentation in the
  111.   recommended version of gcc should tell you if you need to upgrade your
  112.   libc.  This is not a difficult procedure, but it is important to
  113.   follow the instructions.
  114.  
  115.   2.5.  What's a loadable module?
  116.  
  117.   These are pieces of kernel code which are not linked (included)
  118.   directly in the kernel. One compiles them separately, and can insert
  119.   and remove them into the running kernel at almost any time. Due to its
  120.   flexibility, this is now the preferred way to code certain kernel
  121.   features. Many popular device drivers, such as the PCMCIA drivers and
  122.   the QIC-80/40 tape driver, are loadable modules.
  123.  
  124.   2.6.  How much disk space do I need?
  125.  
  126.   It depends on your particular system configuration. First, the
  127.   compressed linux source is nearly 6 megabytes large at version 2.0.10.
  128.   Most sites keep this even after unpacking.  Uncompressed, it takes up
  129.   24 MB. But that's not the end -- you need more to actually compile the
  130.   thing. This depends on how much you configure into your kernel. For
  131.   example, on one particular machine, I have networking, the 3Com 3C509
  132.   driver, and three filesystems configured, using close to 30 MB. Adding
  133.   the compressed linux source, you need about 36 MB for this particular
  134.   configuration. On another system, without network device support (but
  135.   still with networking support), and sound card support, it consumes
  136.   even more. Also, a newer kernel is certain to have a larger source
  137.   tree than an older one, so, in general, if you have a lot of hardware,
  138.   make sure that you have a big enough hard disk in that mess (and at
  139.   today's prices, I cannot help but to recommend getting another disk
  140.   space as an answer to your storage problems).
  141.  
  142.   2.7.  How long does it take?
  143.  
  144.   For most people, the answer is ``fairly long.'' The speed of your
  145.   system and the amount of memory you have ultimately determines the
  146.   time, but there is a small bit to do with the amount of stuff you
  147.   configure into the kernel. On a 486DX4/100 with 16 MB of RAM, on a
  148.   v1.2 kernel with five filesystems, networking support, and sound card
  149.   drivers, it takes around 20 minutes. On a 386DX/40 (8 MB RAM) with a
  150.   similar configuration, compilation lasts nearly 1.5 hours. It is a
  151.   generally good recommendation to make a little coffee, watch some TV,
  152.   knit, or whatever you do for fun while your machine compiles the
  153.   kernel. You can have someone else with a faster machine compile it for
  154.   you if you really have a slow machine.
  155.  
  156.   3.  How to actually configure the kernel
  157.  
  158.   3.1.  Getting the source
  159.  
  160.   You can obtain the source via anonymous ftp from ftp.funet.fi in
  161.   /pub/OS/Linux/PEOPLE/Linus, a mirror, or other sites.  It is typically
  162.   labelled linux-x.y.z.tar.gz, where x.y.z is the version number. Newer
  163.   (better?) versions and the patches are typically in subdirectories
  164.   such as `v1.1' and `v1.2' The highest number is the latest version,
  165.   and is usually a ``test release,'' meaning that if you feel uneasy
  166.   about beta or alpha releases, you should stay with a major release.
  167.  
  168.   I strongly suggest that you use a mirror ftp site instead of
  169.   ftp.funet.fi. Here is a short list of mirrors and other sites:
  170.  
  171.   USA:         tsx-11.mit.edu:/pub/linux/sources/system
  172.   USA:         sunsite.unc.edu:/pub/Linux/kernel
  173.   UK:          sunsite.doc.ic.ac.uk:/pub/unix/Linux/sunsite.unc-mirror/kernel
  174.   Austria:     fvkma.tu-graz.ac.at:/pub/linux/linus
  175.   Germany:     ftp.Germany.EU.net:/pub/os/Linux/Local.EUnet/Kernel/Linus
  176.   Germany:     sunsite.informatik.rwth-aachen.de:/pub/Linux/PEOPLE/Linus
  177.   France:      ftp.ibp.fr:/pub/linux/sources/system/patches
  178.   Australia:   ftp.dstc.edu.au:/pub/linux/kernel
  179.  
  180.   If you do not have ftp access, a list of BBS systems which carry linux
  181.   is posted periodically to comp.os.linux.announce; try to obtain this.
  182.  
  183.   3.2.  Unpacking the source
  184.  
  185.   Log in as or su to `root', and cd to /usr/src.  If you installed
  186.   kernel source when you first installed linux (as most do), there will
  187.   already be a directory called `linux' there, which contains the entire
  188.   old source tree.  If you have the disk space and you want to play it
  189.   safe, preserve that directory. A good idea is to figure out what
  190.   version your system runs now and rename the directory accordingly. The
  191.   command `uname -r' prints the current kernel version.  Therefore, if
  192.   `uname -r' said `1.0.9', you would rename (with `mv') `linux' to
  193.   `linux-1.0.9'.  If you feel mildly reckless, just wipe out the entire
  194.   directory. In any case, make certain there is no `linux' directory in
  195.   /usr/src before unpacking the full source code.
  196.  
  197.   Now, in /usr/src, unpack the source with `tar zxpvf linux-
  198.   x.y.z.tar.gz' (if you've just got a .tar  file with no .gz at the end,
  199.   `tar xpvf linux-x.y.z.tar' works.).  The contents of the source will
  200.   fly by. When finished, there will be a new `linux' directory in
  201.   /usr/src. cd to linux and look over the README  file.  There will be a
  202.   section with the label `INSTALLING the kernel'.  Carry out the
  203.   instructions when appropriate -- symbolic links that should be in
  204.   place, removal of stale .o files, etc.
  205.  
  206.   3.3.  Configuring the kernel
  207.  
  208.   Note: Some of this is reiteration/clarification of a similar section
  209.   in Linus' README file.
  210.  
  211.   The command `make config' while in /usr/src/linux starts a configure
  212.   script which asks you many questions. It requires bash, so verify that
  213.   bash is /bin/bash, /bin/sh, or $BASH.
  214.  
  215.   You are ready to answer the questions, usually with `y' (yes) or `n'
  216.   (no). Device drivers typically have an `m' option.  This means
  217.   ``module,'' meaning that the system will compile it, but not directly
  218.   into the kernel, but as a loadable module. A more comical way to
  219.   describe it is as ``maybe.'' Some of the more obvious and non-critical
  220.   options are not described here; see the section ``Other configuration
  221.   options'' for short descriptions of a few others.
  222.  
  223.   In 2.0.x and later, there is a `?' option. Typing this will give you a
  224.   brief description of the configuration parameter.
  225.  
  226.   3.3.1.  Kernel math emulation
  227.  
  228.   If you don't have a math coprocessor (you have a bare 386 or 486SX),
  229.   you must say `y' to this. If you do have a coprocessor and you still
  230.   say `y', don't worry too much -- the coprocessor is still used and the
  231.   emulation ignored. The only consequence is that the kernel will be
  232.   larger (costing RAM). I have been told that the math emulation is
  233.   slow; although this does not have much to do with this section, it
  234.   might be something to keep in mind when faced with sluggish X window
  235.   system performance.
  236.  
  237.   3.3.2.  Normal (MFM/RLL) disk and IDE disk/cdrom support
  238.  
  239.   You probably need to support this; it means that the kernel will
  240.   support standard PC hard disks, which most people have. This driver
  241.   does not include SCSI drives; they come later in the configuration.
  242.  
  243.   You will then be asked about the ``old disk-only'' and ``new IDE''
  244.   drivers.  You want to choose one of them; the main difference is that
  245.   the old driver only supports two disks on a single interface, and the
  246.   new one supports a secondary interface and IDE/ATAPI cdrom drives. The
  247.   new driver is 4k larger than the old one and is also supposedly
  248.   ``improved,'' meaning that aside from containing a different number of
  249.   bugs, it might improve your disk performance, especially if you have
  250.   newer (EIDE-type) hardware.
  251.  
  252.   3.3.3.  Networking support
  253.  
  254.   In principle, you would only say `y' if your machine is on a network
  255.   such as the internet, or you want to use SLIP, PPP, term, etc to dial
  256.   up for internet access. However, as many packages (such as the X
  257.   window system) require networking support even if your machine does
  258.   not live on a real network, you should say `y'. Later on, you will be
  259.   asked if you want to support TCP/IP networking; again, say `y' here if
  260.   you are not absolutely sure.
  261.  
  262.   3.3.4.  Limit memory to low 16MB
  263.  
  264.   There exist buggy 386 DMA controllers which have problems with
  265.   addressing anything more than 16 MB of RAM; you want to say `y' in the
  266.   (rare) case that you have one.
  267.  
  268.   3.3.5.  System V IPC
  269.  
  270.   One of the best definitions of IPC (Interprocess Communication) is in
  271.   the Perl book's glossary. Not surprisingly, some Perl programmers
  272.   employ it to let processes talk to each other, as well as many other
  273.   packages (DOOM, most notably), so it is not a good idea to say n
  274.   unless you know exactly what you are doing.
  275.  
  276.   3.3.6.  Processor type (386, 486, Pentium, PPro)
  277.  
  278.   (in older kernels: Use -m486 flag for 486-specific optimizations)
  279.  
  280.   Traditionally, this compiled in certain optimizations for a particular
  281.   processor; the kernels ran fine on other chips, but the kernel was
  282.   perhaps a bit larger. In newer kernels, however, this is no longer
  283.   true, so you should enter the processor for which you are compiling
  284.   the kernel. A ``386'' kernel will work on all machines.
  285.  
  286.   3.3.7.  SCSI support
  287.  
  288.   If you have SCSI devices, say `y'. You will be prompted for further
  289.   information, such as support for CD-ROM, disks, and what kind of SCSI
  290.   adapter you have. See the SCSI-HOWTO for greater detail.
  291.  
  292.   3.3.8.  Network device support
  293.  
  294.   If you have a network card, or you would like to use SLIP, PPP, or a
  295.   parallel port adapter for connecting to the Internet, say `y'. The
  296.   config script will prompt for which kind of card you have, and which
  297.   protocol to use.
  298.  
  299.   3.3.9.  Filesystems
  300.  
  301.   The configure script then asks if you wish to support the following
  302.   filesystems:
  303.  
  304.   Standard (minix) - Newer distributions don't create minix filesystems,
  305.   and many people don't use it, but it may still be a good idea to
  306.   configure this one. Some ``rescue disk'' programs use it, and still
  307.   more floppies may have a minix filesystem, since the minix filesystem
  308.   is less painful to use on a floppy.
  309.  
  310.   Extended fs - This was the first version of the extended filesystem,
  311.   which is no longer in widespread use. Chances are that you'll know it
  312.   if you need it and that if you are doubt, you do not need it.
  313.  
  314.   Second extended - This is widely used in new distributions. You
  315.   probably have one of these, and need to say `y'.
  316.  
  317.   xiafs filesystem - At one time, this was not uncommon, but at the time
  318.   of this writing, I did not know of anyone using it.
  319.  
  320.   msdos - If you want to use your MS-DOS hard disk partitions, or mount
  321.   MS-DOS formatted floppy disks, say `y'.
  322.  
  323.   umsdos - This filesystem expands an MS-DOS filesystem with usual Unix-
  324.   like features such as long filenames. It is not useful for people
  325.   (like me) who ``don't do DOS.''
  326.  
  327.   /proc - Another one of the greatest things since powdered milk (idea
  328.   shamelessly stolen from Bell Labs, I guess). One doesn't make a proc
  329.   filesystem on a disk; this is a filesystem interface to the kernel and
  330.   processes. Many process listers (such as `ps') use it. Try `cat
  331.   /proc/meminfo' or `cat /proc/devices' sometime.  Some shells (rc, in
  332.   particular) use /proc/self/fd  (known as /dev/fd on other systems) for
  333.   I/O. You should almost certainly say `y' to this; many important linux
  334.   tools depend on it.
  335.  
  336.   NFS - If your machine lives on a network and you want to use
  337.   filesystems which reside on other systems with NFS, say `y'.
  338.  
  339.   ISO9660 - Found on most CD-ROMs. If you have a CD-ROM drive and you
  340.   wish to use it under Linux, say `y'.
  341.  
  342.   OS/2 HPFS - At the time of this writing, a read-only fs for OS/2 HPFS.
  343.  
  344.   System V and Coherent - for partitions of System V and Coherent
  345.   systems (These are other PC Unix variants).
  346.  
  347.   3.3.9.1.  But I don't know which filesystems I need!
  348.  
  349.   Ok, type `mount'. The output will look something like this:
  350.  
  351.            blah# mount
  352.            /dev/hda1 on / type ext2 (defaults)
  353.            /dev/hda3 on /usr type ext2 (defaults)
  354.            none on /proc type proc (defaults)
  355.            /dev/fd0 on /mnt type msdos (defaults)
  356.  
  357.   Look at each line; the word next to `type' is the filesystem type. In
  358.   this example, my /  and /usr filesystems are second extended, I'm
  359.   using /proc, and there's a floppy disk mounted using the msdos (bleah)
  360.   filesystem.
  361.  
  362.   You can try `cat /proc/filesystems' if you have /proc currently
  363.   enabled; it will list your current kernel's filesystems.
  364.  
  365.   The configuration of rarely-used, non-critical filesystems can cause
  366.   kernel bloat; see the section on modules for a way to avoid this and
  367.   the ``Pitfalls'' section on why a bloated kernel is undesirable.
  368.  
  369.   3.3.10.  Character devices
  370.  
  371.   Here, you enable the drivers for your printer (parallel printer, that
  372.   is), busmouse, PS/2 mouse (many notebooks use the PS/2 mouse protocol
  373.   for their built-in trackballs), some tape drives, and other such
  374.   ``character'' devices. Say `y' when appropriate.
  375.  
  376.   Note: Selection is a program which allows the use of the mouse outside
  377.   of the X window system for cut and paste between virtual consoles.
  378.   It's fairly nice if you have a serial mouse, because it coexists well
  379.   with X, but you need to do special tricks for others. Selection
  380.   support was a configuration option at one time, but is now standard.
  381.  
  382.   Note 2: Selection is now considered obsolete. ``gpm'' is the name of
  383.   the new program. It can do fancier things, such translate mouse
  384.   protocols, handle multiple mice, ..
  385.  
  386.   3.3.11.  Sound card
  387.  
  388.   If you feel a great desire to hear biff bark, say `y', and later on,
  389.   another config program will compile and ask you all about your sound
  390.   board. (A note on sound card configuration: when it asks you if you
  391.   want to install the full version of the driver, you can say `n' and
  392.   save some kernel memory by picking only the features which you deem
  393.   necessary.) I highly recommend looking at the  Sound-HOWTO for more
  394.   detail about sound support if you have a sound card.
  395.  
  396.   3.3.12.  Other configuration options
  397.  
  398.   Not all of the configuration options are listed here because they
  399.   change too often or fairly self-evident (for instance, 3Com 3C509
  400.   support to compile the device drive for this particular ethernet
  401.   card).  There exists a fairly comprehensive list of all the options
  402.   (plus a way to place them into the Configure script) put together by
  403.   Axel Boldt (axel@uni-paderborn.de) with the following URL:
  404.  
  405.        http://math-www.uni-paderborn.de/~axel/config_help.html
  406.  
  407.   or via anonymous FTP at:
  408.  
  409.        ftp://sunsite.unc.edu/pub/Linux/kernel/config/krnl_cnfg_hlp.x.yz.tgz
  410.  
  411.   where the x.yz is the version number.
  412.  
  413.   For later (2.0.x and later) kernels, this has been integrated into the
  414.   source tree.
  415.  
  416.   3.3.13.  Kernel hacking
  417.  
  418.   >From Linus' README:
  419.  
  420.   the ``kernel hacking'' configuration details usually result in a
  421.   bigger or slower kernel (or both), and can even make the kernel less
  422.   stable by configuring some routines to actively try to break bad code
  423.   to find kernel problems (kmalloc()).  Thus you should probably answer
  424.   `n' to the questions for a ``production'' kernel.
  425.  
  426.   3.4.  Now what? (The Makefile)
  427.  
  428.   After you make config, a message tells you that your kernel has been
  429.   configured, and to ``check the top-level Makefile for additional
  430.   configuration,'' etc.
  431.  
  432.   So, look at the Makefile. You probably will not need to change it, but
  433.   it never hurts to look. You can also change its options with the
  434.   `rdev' command once the new kernel is in place.
  435.  
  436.   4.  Compiling the kernel
  437.  
  438.   4.1.  Cleaning and depending
  439.  
  440.   When the configure script ends, it also tells you to `make dep' and
  441.   `clean'.  So, do the `make dep'. This insures that all of the
  442.   dependencies, such the include files, are in place. It does not take
  443.   long, unless your computer is fairly slow to begin with.  When
  444.   finished, do a `make clean'.  This removes all of the object files and
  445.   some other things that an old version leaves behind. Do not forget
  446.   this step.
  447.  
  448.   4.2.  Compile time
  449.  
  450.   After depending and cleaning, you may now `make zImage' or `make
  451.   zdisk' (this is the part that takes a long time.).  `make zImage' will
  452.   compile the kernel, and leave a file in arch/i386/boot called `zImage'
  453.   (among other things). This is the new compressed kernel. `make zdisk'
  454.   does the same thing, but also places the new zImage on a floppy disk
  455.   which you hopefully put in drive ``A:''.  `zdisk' is fairly handy for
  456.   testing new kernels; if it bombs (or just doesn't work right), just
  457.   remove the floppy and boot with your old kernel. It can also be a
  458.   handy way to boot if you accidentally remove your kernel (or something
  459.   equally as dreadful). You can also use it to install new systems when
  460.   you just dump the contents of one disk onto the other (``all this and
  461.   more! NOW how much would you pay?'').
  462.  
  463.   All even halfway reasonably recent kernels are compressed, hence the
  464.   `z' in front of the names. A compressed kernel automatically
  465.   decompresses itself when executed.
  466.  
  467.   4.3.  Other ``make''ables
  468.  
  469.   `make mrproper' will do a more extensive `clean'ing.  It is sometimes
  470.   necessary; you may wish to do it at every patch. `make mrproper' will
  471.   also delete your configuration file, so you might want to make a
  472.   backup of it (.config) if you see it as valuable.
  473.  
  474.   `make oldconfig' will attempt to configure the kernel from an old
  475.   configuration file; it will run through the `make config' process for
  476.   you. If you haven't ever compiled a kernel before or don't have an old
  477.   config file, then you probably shouldn't do this, as you will most
  478.   likely want to change the default configuration.
  479.  
  480.   See the section on modules for a description of `make modules'.
  481.  
  482.   4.4.  Installing the kernel
  483.  
  484.   After you have a new kernel that seems to work the way you want it to,
  485.   it's time to install it. Most people use LILO (Linux Loader) for this.
  486.   `make zlilo' will install the kernel, run LILO on it, and get you all
  487.   ready to boot, BUT ONLY if lilo is configured in the following way on
  488.   your system: kernel is /vmlinuz, lilo is in /sbin, and your lilo
  489.   config (/etc/lilo.conf) agrees with this.
  490.  
  491.   Otherwise, you need to use LILO directly. It's a fairly easy package
  492.   to install and work with, but it has a tendency to confuse people with
  493.   the configuration file.  Look at the config file (either
  494.   /etc/lilo/config for older versions or /etc/lilo.conf for new
  495.   versions), and see what the current setup is. The config file looks
  496.   like this:
  497.  
  498.       image = /vmlinuz
  499.           label = Linux
  500.           root = /dev/hda1
  501.           ...
  502.  
  503.   The `image =' is set to the currently installed kernel.  Most people
  504.   use /vmlinuz. `label' is used by lilo to determine which kernel or
  505.   operating system to boot, and `root' is the / of that particular
  506.   operating system. Make a backup copy of your old kernel and copy the
  507.   zImage which you just made into place (you would say `cp zImage
  508.   /vmlinuz' if you use `/vmlinuz').  Then, rerun lilo -- on newer
  509.   systems, you can just run `lilo', but on older stuff, you might have
  510.   to do an /etc/lilo/install or even an /etc/lilo/lilo -C
  511.   /etc/lilo/config.
  512.  
  513.   If you would like to know more about LILO's configuration, or you
  514.   don't have LILO, get the newest version from your favorite ftp site
  515.   and follow the instructions.
  516.  
  517.   To boot one of your old kernels off the hard disk (another way to save
  518.   yourself in case you screw up the new kernel), copy the lines below
  519.   (and including) `image = xxx' in the LILO config file to the bottom of
  520.   the file, and change the `image = xxx' to `image = yyy', where `yyy'
  521.   is the full pathname of the file you saved your backup kernel to.
  522.   Then, change the `label = zzz' to `label = linux-backup' and rerun
  523.   lilo. You may need to put a line in the config file saying `delay=x',
  524.   where x is an amount in tenths of a second, which tells LILO to wait
  525.   that much time before booting, so that you can interrupt it (with the
  526.   shift key, for example), and type in the label of the backup boot
  527.   image (in case unpleasant things happen).
  528.  
  529.   5.  Patching the kernel
  530.  
  531.   5.1.  Applying a patch
  532.  
  533.   Incremental upgrades of the kernel are distributed as patches. For
  534.   example, if you have version 1.1.45, and you notice that there's a
  535.   `patch46.gz' out there for it, it means you can upgrade to version
  536.   1.1.46 through application of the patch. You might want to make a
  537.   backup of the source tree first (`make clean' and then `cd /usr/src;
  538.   tar zcvf old-tree.tar.gz linux' will make a compressed tar archive for
  539.   you.).
  540.  
  541.   So, continuing with the example above, let's suppose that you have
  542.   `patch46.gz' in /usr/src. cd to /usr/src  and do a `zcat patch46.gz |
  543.   patch -p0' (or `patch -p0 < patch46' if the patch isn't compressed).
  544.   You'll see things whizz by (or flutter by, if your system is that
  545.   slow) telling you that it is trying to apply hunks, and whether it
  546.   succeeds or not. Usually, this action goes by too quickly for you to
  547.   read, and you're not too sure whether it worked or not, so you might
  548.   want to use the -s flag to patch, which tells patch to only report
  549.   error messages (you don't get as much of the ``hey, my computer is
  550.   actually doing something for a change!'' feeling, but you may prefer
  551.   this..). To look for parts which might not have gone smoothly, cd to
  552.   /usr/src/linux  and look for files with a .rej extension. Some
  553.   versions of patch (older versions which may have been compiled with on
  554.   an inferior filesystem) leave the rejects with a # extension. You can
  555.   use `find' to look for you;
  556.  
  557.       find .  -name '*.rej' -print
  558.  
  559.   prints all files who live in the current directory or any subdirecto¡
  560.   ries with a .rej extension to the standard output.
  561.  
  562.   If everything went right, do a `make clean', `config', and `dep' as
  563.   described in sections 3 and 4.
  564.  
  565.   There are quite a few options to the patch command. As mentioned
  566.   above, patch -s will suppress all messages except the errors. If you
  567.   keep your kernel source in some other place than /usr/src/linux, patch
  568.   -p1 (in that directory) will patch things cleanly. Other patch options
  569.   are well-documented in the manual page.
  570.  
  571.   5.2.  If something goes wrong
  572.  
  573.   The most frequent problem that used to arise was when a patch modified
  574.   a file called `config.in' and it didn't look quite right, because you
  575.   changed the options to suit your machine. This has been taken care of,
  576.   but one still might encounter it with an older release.  To fix it,
  577.   look at the config.in.rej  file, and see what remains of the original
  578.   patch.  The changes will typically be marked with `+' and `-' at the
  579.   beginning of the line. Look at the lines surrounding it, and remember
  580.   if they were set to `y' or `n'. Now, edit config.in, and change `y' to
  581.   `n' and `n' to `y' when appropriate. Do a
  582.  
  583.       patch -p0 < config.in.rej
  584.  
  585.   and if it reports that it succeeded (no fails), then you can continue
  586.   on with a configuration and compilation. The config.in.rej file will
  587.   remain, but you can get delete it.
  588.  
  589.   If you encounter further problems, you might have installed a patch
  590.   out of order. If patch says `previously applied patch detected: Assume
  591.   -R?', you are probably trying to apply a patch which is below your
  592.   current version number; if you answer `y', it will attempt to degrade
  593.   your source, and will most likely fail; thus, you will need to get a
  594.   whole new source tree (which might not have been such a bad idea in
  595.   the first place).
  596.  
  597.   To back out (unapply) a patch, use `patch -R' on the original patch.
  598.  
  599.   The best thing to do when patches really turn out wrong is to start
  600.   over again with a clean, out-of-the-box source tree (for example, from
  601.   one of the linux-x.y.z.tar.gz  files), and start again.
  602.  
  603.   5.3.  Getting rid of the .orig files
  604.  
  605.   After just a few patches, the .orig  files will start to pile up. For
  606.   example, one 1.1.51 tree I had was once last cleaned out at 1.1.48.
  607.   Removing the .orig files saved over a half a meg.
  608.  
  609.       find .  -name '*.orig' -exec rm -f {} ';'
  610.  
  611.   will take care of it for you. Versions of patch which use # for
  612.   rejects use a tilde instead of .orig.
  613.  
  614.   There are better ways to get rid of the .orig files, which depend on
  615.   GNU xargs:
  616.  
  617.       find .  -name '*.orig' | xargs rm
  618.  
  619.   or the ``quite secure but a little more verbose'' method:
  620.  
  621.       find . -name '*.orig' -print0 | xargs --null rm --
  622.  
  623.   5.4.  Other patches
  624.  
  625.   There are other patches (I'll call them ``nonstandard'') than the ones
  626.   Linus distributes. If you apply these, Linus' patches may not work
  627.   correctly and you'll have to either back them out, fix the source or
  628.   the patch, install a new source tree, or a combination of the above.
  629.   This can become very frustrating, so if you do not want to modify the
  630.   source (with the possibility of a very bad outcome), back out the
  631.   nonstandard patches before applying Linus', or just install a new
  632.   tree. Then, you can see if the nonstandard patches still work. If they
  633.   don't, you are either stuck with an old kernel, playing with the patch
  634.   or source to get it to work, or waiting (possibly begging) for a new
  635.   version of the patch to come out.
  636.  
  637.   How common are the patches not in the standard distribution? You will
  638.   probably hear of them. I used to use the noblink patch for my virtual
  639.   consoles because I hate blinking cursors (This patch is (or at least
  640.   was) frequently updated for new kernel releases.). With most newer
  641.   device drivers being developed as loadable modules, though, the
  642.   frequecy of ``nonstandard'' patches is decreasing significantly.
  643.  
  644.   6.  Additional packages
  645.  
  646.   Your linux kernel has many features which are not explained in the
  647.   kernel source itself; these features are typically utilized through
  648.   external packages. Some of the most common are listed here.
  649.  
  650.   6.1.  kbd
  651.  
  652.   The linux console probably has more features than it deserves. Among
  653.   these are the ability to switch fonts, remap your keyboard, switch
  654.   video modes (in newer kernels), etc. The kbd package has programs
  655.   which allow the user to do all of this, plus many fonts and keyboard
  656.   maps for almost any keyboard, and is available from the same sites
  657.   that carry the kernel source.
  658.  
  659.   6.2.  util-linux
  660.  
  661.   Rik Faith (faith@cs.unc.edu) put together a large collection of linux
  662.   utilities which are, by odd coincidence, called util-linux. These are
  663.   now maintained by Nicolai Langfeldt (util-linux@math.uio.no).
  664.   Available via anonymous ftp from sunsite.unc.edu in
  665.   /pub/Linux/system/Misc, it contains programs such as setterm, rdev,
  666.   and ctrlaltdel, which are relevant to the kernel. As Rik says, do not
  667.   install without thinking; you do not need to install everything in the
  668.   package, and it could very well cause serious problems if you do.
  669.  
  670.   6.3.  hdparm
  671.  
  672.   As with many packages, this was once a kernel patch and support
  673.   programs.  The patches made it into the official kernel, and the
  674.   programs to optimize and play with your hard disk are distributed
  675.   separately.
  676.  
  677.   6.4.  gpm
  678.  
  679.   gpm stands for general purpose mouse. This program allows you to cut
  680.   and paste text between virtual consoles and do other things with a
  681.   large variety of mouse types.
  682.  
  683.   7.  Some pitfalls
  684.  
  685.   7.1.  make clean
  686.  
  687.   If your new kernel does really weird things after a routine kernel
  688.   upgrade, chances are you forgot to make clean before compiling the new
  689.   kernel. Symptoms can be anything from your system outright crashing,
  690.   strange I/O problems, to crummy performance. Make sure you do a make
  691.   dep, too.
  692.  
  693.   7.2.  Huge or slow kernels
  694.  
  695.   If your kernel is sucking up a lot of memory, is too large, and/or
  696.   just takes forever to compile even when you've got your new 786DX6/440
  697.   working on it, you've probably got lots of unneeded stuff (device
  698.   drivers, filesystems, etc) configured. If you don't use it, don't
  699.   configure it, because it does take up memory.  The most obvious
  700.   symptom of kernel bloat is extreme swapping in and out of memory to
  701.   disk; if your disk is making a lot of noise and it's not one of those
  702.   old Fujitsu Eagles that sound like like a jet landing when turned off,
  703.   look over your kernel configuration.
  704.  
  705.   You can find out how much memory the kernel is using by taking the
  706.   total amount of memory in your machine and subtracting it from the
  707.   amount of ``total mem'' in /proc/meminfo  or the output of the command
  708.   `free'. You can also find out by doing a `dmesg' (or by looking at the
  709.   kernel log file, wherever it is on your system).  There will be a line
  710.   which looks like this:
  711.  
  712.   Memory: 15124k/16384k available (552k kernel code, 384k reserved, 324k
  713.   data)
  714.  
  715.   My 386 (which has slightly less junk configured) says this:
  716.  
  717.   Memory: 7000k/8192k available (496k kernel code, 384k reserved, 312k
  718.   data)
  719.  
  720.   7.3.  Kernel doesn't compile
  721.  
  722.   If it does not compile, then it is likely that a patch failed, or your
  723.   source is somehow corrupt. Your version of gcc also might not be
  724.   correct, or could also be corrupt (for example, the include files
  725.   might be in error). Make sure that the symbolic links which Linus
  726.   describes in the README are set up correctly. In general, if a
  727.   standard kernel does not compile, something is seriously wrong with
  728.   the system, and reinstallation of certain tools is probably necessary.
  729.  
  730.   Or perhaps you're compiling a 1.2.x kernel with an ELF compiler (gcc
  731.   2.6.3 and higher). If you're getting a bunch of so-and-so undefined
  732.   messages during the compilation, chances are that this is your
  733.   problem. The fix is in most cases very simple. Add these lines to the
  734.   top of arch/i386/Makefile:
  735.  
  736.   AS=/usr/i486-linuxaout/bin/as
  737.   LD=/usr/i486-linuxaout/bin/ld -m i386linux
  738.   CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
  739.  
  740.   Then make dep and zImage again.
  741.  
  742.   In very, very rare cases, gcc can crash due to hardware problems. The
  743.   error message will be something like ``xxx exited with signal 15'' and
  744.   it will generally look very mysterious. I probably would not mention
  745.   this, except that it happened to me once - I had some bad cache
  746.   memory, and the compiler would occasionally barf at random. Try
  747.   reinstalling gcc first if you experience problems. You should only get
  748.   suspicious if your kernel compiles fine with external cache turned
  749.   off, a reduced amount of RAM, etc.
  750.  
  751.   7.4.  New version of the kernel doesn't seem to boot
  752.  
  753.   You did not run LILO, or it is not configured correctly. One thing
  754.   that ``got'' me once was a problem in the config file; it said `boot =
  755.   /dev/hda1' instead of `boot = /dev/hda' (This can be really annoying
  756.   at first, but once you have a working config file, you shouldn't need
  757.   to change it.).
  758.  
  759.   7.5.  You forgot to run LILO, or system doesn't boot at all
  760.  
  761.   Ooops! The best thing you can do here is to boot off of a floppy disk
  762.   and prepare another bootable floppy (such as `make zdisk' would do).
  763.   You need to know where your root (/) filesystem is and what type it is
  764.   (e.g. second extended, minix). In the example below, you also need to
  765.   know what filesystem your /usr/src/linux source tree is on, its type,
  766.   and where it is normally mounted.
  767.  
  768.   In the following example, / is /dev/hda1, and the filesystem which
  769.   holds /usr/src/linux is /dev/hda3, normally mounted at /usr. Both are
  770.   second extended filesystems. The working kernel image in
  771.   /usr/src/linux/arch/i386/boot is called zImage.
  772.  
  773.   The idea is that if there is a functioning zImage, it is possible to
  774.   use that for the new floppy. Another alternative, which may or may not
  775.   work better (it depends on the particular method in which you messed
  776.   up your system) is discussed after the example.
  777.  
  778.   First, boot from a boot/root disk combo or rescue disk, and mount the
  779.   filesystem which contains the working kernel image:
  780.  
  781.       mkdir /mnt
  782.       mount -t ext2 /dev/hda3 /mnt
  783.  
  784.   If mkdir tells you that the directory already exists, just ignore it.
  785.   Now, cd to the place where the working kernel image was. Note that
  786.  
  787.   /mnt + /usr/src/linux/arch/i386/boot - /usr = /mnt/src/linux/arch/i386/boot
  788.  
  789.   Place a formatted disk in drive ``A:'' (not your boot or root disk!),
  790.   dump the image to the disk, and configure it for your root filesystem:
  791.  
  792.       cd /mnt/src/linux/arch/i386/boot
  793.       dd if=zImage of=/dev/fd0
  794.       rdev /dev/fd0 /dev/hda1
  795.  
  796.   cd to / and unmount the normal /usr filesystem:
  797.  
  798.       cd /
  799.       umount /mnt
  800.  
  801.   You should now be able to reboot your system as normal from this
  802.   floppy.  Don't forget to run lilo (or whatever it was that you did
  803.   wrong) after the reboot!
  804.  
  805.   As mentioned above, there is another common alternative. If you
  806.   happened to have a working kernel image in / (/vmlinuz for example),
  807.   you can use that for a boot disk. Supposing all of the above
  808.   conditions, and that my kernel image is /vmlinuz, just make these
  809.   alterations to the example above: change /dev/hda3 to /dev/hda1 (the /
  810.   filesystem), /mnt/src/linux to /mnt, and if=zImage to if=vmlinuz. The
  811.   note explaining how to derive /mnt/src/linux may be ignored.
  812.  
  813.   Using LILO with big drives (more than 1024 cylinders) can cause
  814.   problems.  See the LILO mini-HOWTO or documentation for help on that.
  815.  
  816.   7.6.  It says `warning: bdflush not running'
  817.  
  818.   This can be a severe problem. Starting with a kernel release after 1.0
  819.   (around 20 Apr 1994), a program called `update' which periodically
  820.   flushes out the filesystem buffers, was upgraded/replaced. Get the
  821.   sources to `bdflush' (you should find it where you got your kernel
  822.   source), and install it (you probably want to run your system under
  823.   the old kernel while doing this). It installs itself as `update' and
  824.   after a reboot, the new kernel should no longer complain.
  825.  
  826.   7.7.  It says stuff about undefined symbols and does not compile
  827.  
  828.   You probably have an ELF compiler (gcc 2.6.3 and up) and the 1.2.x (or
  829.   earlier) kernel source. The usual fix is to add these three lines to
  830.   the top of arch/i386/Makefile:
  831.  
  832.   AS=/usr/i486-linuxaout/bin/as
  833.   LD=/usr/i486-linuxaout/bin/ld -m i386linux
  834.   CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
  835.  
  836.   This will compile a 1.2.x kernel with the a.out libraries.
  837.  
  838.   7.8.  I can't get my IDE/ATAPI CD-ROM drive to work
  839.  
  840.   Strangely enough, lots of people cannot get their ATAPI drives
  841.   working, probably because there are a number of things that can go
  842.   wrong.
  843.  
  844.   If your CD-ROM drive is the only device on a particular IDE interface,
  845.   it must be jumpered as ``master'' or ``single.'' Supposedly, this is
  846.   the most common error.
  847.  
  848.   Creative Labs (for one) has put IDE interfaces on their sound cards
  849.   now.  However, this leads to the interesting problem that while some
  850.   people only have one interface to being with, many have two IDE
  851.   interfaces built-in to their motherboards (at IRQ15, usually), so a
  852.   common practice is to make the soundblaster interface a third IDE port
  853.   (IRQ11, or so I'm told).
  854.  
  855.   This causes problems with linux in that versions 1.2.x don't support a
  856.   third IDE interface (there is support in starting somewhere in the
  857.   1.3.x series but that's development, remember, and it doesn't auto-
  858.   probe). To get around this, you have a few choices.
  859.  
  860.   If you have a second IDE port already, chances are that you are not
  861.   using it or it doesn't already have two devices on it. Take the ATAPI
  862.   drive off the sound card and put it on the second interface. You can
  863.   then disable the sound card's interface, which saves an IRQ anyway.
  864.  
  865.   If you don't have a second interface, jumper the sound card's
  866.   interface (not the sound card's sound part) as IRQ15, the second
  867.   interface. It should work.
  868.  
  869.   If for some reason it absolutely has to be on a so-called ``third''
  870.   interface, or there are other problems, get a 1.3.x kernel (1.3.57 has
  871.   it, for example), and read over drivers/block/README.ide. There is
  872.   much more information here.
  873.  
  874.   7.9.  It says weird things about obsolete routing requests
  875.  
  876.   Get new versions of the route program and any other programs which do
  877.   route manipulation.  /usr/include/linux/route.h  (which is actually a
  878.   file in /usr/src/linux) has changed.
  879.  
  880.   7.10.  Firewalling not working in 1.2.0
  881.  
  882.   Upgrade to at least version 1.2.1.
  883.  
  884.   7.11.  ``Not a compressed kernel Image file''
  885.  
  886.   Don't use the vmlinux file created in /usr/src/linux as your boot
  887.   image; [..]/arch/i386/boot/zImage is the right one.
  888.  
  889.   7.12.  Problems with console terminal after upgrade to 1.3.x
  890.  
  891.   Change the word dumb to linux in the console termcap entry in
  892.   /etc/termcap. You may also have to make a terminfo entry.
  893.  
  894.   7.13.  Can't seem to compile things after kernel upgrade
  895.  
  896.   The linux kernel source includes a number of include files (the things
  897.   that end with .h) which are referenced by the standard ones in
  898.   /usr/include. They are typically referenced like this (where xyzzy.h
  899.   would be something in /usr/include/linux):
  900.  
  901.       #include <linux/xyzzy.h>
  902.  
  903.   Normally, there is a link called linux in /usr/include to the
  904.   include/linux directory of your kernel source
  905.   (/usr/src/linux/include/linux in the typical system). If this link is
  906.   not there, or points to the wrong place, most things will not compile
  907.   at all. If you decided that the kernel source was taking too much room
  908.   on the disk and deleted it, this will obviously be a problem. Another
  909.   way it might go wrong is with file permissions; if your root has a
  910.   umask which doesn't allow other users to see its files by default, and
  911.   you extracted the kernel source without the p (preserve filemodes)
  912.   option, those users also won't be able to use the C compiler. Although
  913.   you could use the chmod command to fix this, it is probably easier to
  914.   re-extract the include files. You can do this the same way you did the
  915.   whole source at the beginning, only with an additional argument:
  916.  
  917.       blah# tar zxvpf linux.x.y.z.tar.gz linux/include
  918.  
  919.   Note: ``make config'' will recreate the /usr/src/linux link if it
  920.   isn't there.
  921.  
  922.   8.  Note for upgrade to version 2.0.x
  923.  
  924.   Kernel version 2.0.x introduced quite a bit of changes for kernel
  925.   installation. The file Documentation/Changes in the 2.0.x source tree
  926.   contains information that you should know when upgrading to version
  927.   2.0.x. You will most likely need to upgrade several key packages, such
  928.   as gcc, libc, and SysVInit, and perhaps alter some system files, so
  929.   expect this. Don't panic, though.
  930.  
  931.   9.  Modules
  932.  
  933.   Loadable kernel modules can save memory and ease configuration. The
  934.   scope of modules has grown to include filesystems, ethernet card
  935.   drivers, tape drivers, printer drivers, and more.
  936.  
  937.   9.1.  Installing the module utilities
  938.  
  939.   The module utilities are available from wherever you got your kernel
  940.   source as modules-x.y.z.tar.gz; choose the highest patchlevel x.y.z
  941.   that is equal to or below that of your current kernel. Unpack it with
  942.   `tar zxvf modules-x.y.z.tar.gz', cd to the directory it creates
  943.   (modules-x.y.z), look over the README, and carry out its installation
  944.   instructions (which is usually something simple, such as make
  945.   install). You should now have the programs insmod, rmmod, ksyms,
  946.   lsmod, genksyms, modprobe, and depmod in /sbin. If you wish, test out
  947.   the utilities with the ``hw'' example driver in insmod; look over the
  948.   INSTALL file in that subdirectory for details.
  949.  
  950.   insmod inserts a module into the running kernel. Modules usually have
  951.   a .o extension; the example driver mentioned above is called
  952.   drv_hello.o, so to insert this, one would say `insmod drv_hello.o'. To
  953.   see the modules that the kernel is currently using, use lsmod. The
  954.   output looks like this:
  955.  
  956.       blah# lsmod
  957.       Module:        #pages:  Used by:
  958.       drv_hello          1
  959.  
  960.   `drv_hello' is the name of the module, it uses one page (4k) of mem¡
  961.   ory, and no other kernel modules depend on it at the moment. To remove
  962.   this module, use `rmmod drv_hello'. Note that rmmod wants a module
  963.   name, not a filename; you get this from lsmod's listing. The other
  964.   module utilities' purposes are documented in their manual pages.
  965.  
  966.   9.2.  Modules distributed with the kernel
  967.  
  968.   As of version 1.2.2, many filesystems, a few SCSI drivers, several
  969.   ethernet adapter drivers, and other odds and ends are loadable as
  970.   modules. To use them, first make sure that you don't configure them
  971.   into the regular kernel; that is, don't say y to it during `make
  972.   config'.  Compile a new kernel and reboot with it. Then, cd to
  973.   /usr/src/linux again, and do a `make modules'. This compiles all of
  974.   the modules which you did not specify in the kernel configuration, and
  975.   places links to them in /usr/src/linux/modules.  You can use them
  976.   straight from that directory or execute `make modules_install', which
  977.   installs them in /lib/modules/x.y.z, where x.y.z is the kernel
  978.   release.
  979.  
  980.   This can be especially handy with filesystems. You may not use the
  981.   minix or msdos filesystems frequently. For example, if I encountered
  982.   an msdos (shudder) floppy, I would insmod
  983.   /usr/src/linux/modules/msdos.o, and then rmmod msdos when finished.
  984.   This procedure saves about 50k of RAM in the kernel during normal
  985.   operation. A small note is in order for the minix filesystem: you
  986.   should always configure it directly into the kernel for use in
  987.   ``rescue'' disks.
  988.  
  989.   10.  Other configuration options
  990.  
  991.   This section contains descriptions of selected kernel configuration
  992.   options (in make config) which are not listed in the configuration
  993.   section.  Most device drivers are not listed here.
  994.  
  995.   10.1.  General setup
  996.  
  997.   Normal floppy disk support - is exactly that. You may wish to read
  998.   over the file drivers/block/README.fd; this is especially important
  999.   for IBM Thinkpad users.
  1000.  
  1001.   XT harddisk support - if you want to use that 8 bit XT controller
  1002.   collecting dust in the corner.
  1003.  
  1004.   PCI bios support - if you have PCI, you may want to give this a shot;
  1005.   be careful, though, as some old PCI motherboards could crash with this
  1006.   option. More information about the PCI bus under linux is found in the
  1007.   PCI-HOWTO.
  1008.  
  1009.   Kernel support for ELF binaries - ELF is an effort to allow binaries
  1010.   to span architectures and operating systems; linux seems is headed in
  1011.   that direction and so you most likely want this.
  1012.  
  1013.   Set version information on all symbols for modules - in the past,
  1014.   kernel modules were recompiled along with every new kernel. If you say
  1015.   y, it will be possible to use modules compiled under a different
  1016.   patchlevel. Read README.modules for more details.
  1017.  
  1018.   10.2.  Networking options
  1019.  
  1020.   Networking options are described in the NET-2-HOWTO (or NET-something-
  1021.   HOWTO).
  1022.  
  1023.   11.  Tips and tricks
  1024.  
  1025.   11.1.  Redirecting output of the make or patch commands
  1026.  
  1027.   If you would like logs of what those `make' or `patch' commands did,
  1028.   you can redirect output to a file. First, find out what shell you're
  1029.   running: `grep root /etc/passwd' and look for something like
  1030.   `/bin/csh'.
  1031.  
  1032.   If you use sh or bash,
  1033.  
  1034.       (command) 2>&1 | tee (output file)
  1035.  
  1036.   will place a copy of (command)'s output in the file `(output file)'.
  1037.  
  1038.   For csh or tcsh, use
  1039.  
  1040.       (command) |& tee (output file)
  1041.  
  1042.   For rc (Note: you probably do not use rc) it's
  1043.  
  1044.       (command) >[2=1] | tee (output file)
  1045.  
  1046.   11.2.  Conditional kernel install
  1047.  
  1048.   Other than using floppy disks, there are several methods of testing
  1049.   out a new kernel without touching the old one. Unlike many other Unix
  1050.   flavors, LILO has the ability to boot a kernel from anywhere on the
  1051.   disk (if you have a large (500 MB or above) disk, please read over the
  1052.   LILO documentation on how this may cause problems). So, if you add
  1053.   something similar to
  1054.  
  1055.       image = /usr/src/linux/arch/i386/zImage
  1056.           label = new_kernel
  1057.  
  1058.   to the end of your LILO configuration file, you can choose to run a
  1059.   newly compiled kernel without touching your old /vmlinuz (after run¡
  1060.   ning lilo, of course). The easiest way to tell LILO to boot a new ker¡
  1061.   nel is to press the shift key at bootup time (when it says LILO on the
  1062.   screen, and nothing else), which gives you a prompt.  At this point,
  1063.   you can enter `new_kernel' to boot the new kernel.
  1064.  
  1065.   If you wish to keep several different kernel source trees on your
  1066.   system at the same time (this can take up a lot of disk space; be
  1067.   careful), the most common way is to name them /usr/src/linux-x.y.z,
  1068.   where x.y.z is the kernel version. You can then ``select'' a source
  1069.   tree with a symbolic link; for example, `ln -sf linux-1.2.2
  1070.   /usr/src/linux' would make the 1.2.2 tree current. Before creating a
  1071.   symbolic link like this, make certain that the last argument to ln is
  1072.   not a real directory (old symbolic links are fine); the result will
  1073.   not be what you expect.
  1074.  
  1075.   11.3.  Kernel updates
  1076.  
  1077.   Russell Nelson (nelson@crynwr.com) summarizes the changes in new
  1078.   kernel releases. These are short, and you might like to look at them
  1079.   before an upgrade. They are available with anonymous ftp from
  1080.   ftp.emlist.com in pub/kchanges or through the URL
  1081.  
  1082.       http://www.crynwr.com/kchanges
  1083.  
  1084.   12.  Other relevant HOWTOs that might be useful
  1085.  
  1086.   ╖  Sound-HOWTO: sound cards and utilities
  1087.  
  1088.   ╖  SCSI-HOWTO: all about SCSI controllers and devices
  1089.  
  1090.   ╖  NET-2-HOWTO: networking
  1091.  
  1092.   ╖  PPP-HOWTO: PPP networking in particular
  1093.  
  1094.   ╖  PCMCIA-HOWTO: about the drivers for your notebook
  1095.  
  1096.   ╖  ELF-HOWTO: ELF: what it is, converting..
  1097.  
  1098.   ╖  Hardware-HOWTO: overview of supported hardware
  1099.  
  1100.   13.  Misc
  1101.  
  1102.   13.1.  Author
  1103.  
  1104.   The author and maintainer of the Linux Kernel-HOWTO is Brian Ward
  1105.   (bri@blah.math.tu-graz.ac.at). Please send me any comments, additions,
  1106.   corrections (Corrections are, in particular, the most important to
  1107.   me.).  Grovel time: If you feel that you really have gotten some
  1108.   benefit out of this and you're feeling especially froody so that you'd
  1109.   just love to help the author (and future documents) out, you could,
  1110.   er, um, send me some unused computer parts that might be lying around,
  1111.   LEGO (R) bricks that you don't need.. useless CD-ROMs.. or maybe just
  1112.   a nice postcard..
  1113.  
  1114.   You can take a look at my `home page' at one of these URLs:
  1115.  
  1116.       http://www.math.psu.edu/ward/
  1117.       http://blah.math.tu-graz.ac.at/~bri/
  1118.  
  1119.   Even though I try to be attentive as possible with mail, please
  1120.   remember that I get a lot of it every day, so it may take a little
  1121.   time to get back to you. Especially when emailing me with a question,
  1122.   please try extra hard to be clear and detailed in your message. If
  1123.   you're writing about non-working hardware (or something like that), I
  1124.   need to know what your hardware configureation is. If you report an
  1125.   error, don't just say ``I tried this but it gave an error;'' I need to
  1126.   know what the error was.  I don't care if you ask simple questions;
  1127.   remember, if you don't ask, you may never get an answer! I'd like to
  1128.   thank everyone who has given me feedback.
  1129.  
  1130.   If you mailed me and did not get an answer within a resonable amount
  1131.   of time (three weeks or more), then chances are that I accidentally
  1132.   deleted your message or something (sorry). Please try again.
  1133.  
  1134.   I get a lot of mail about thing which are actually hardware problems
  1135.   or issues. That's OK, but please try to keep in mind that I'm not
  1136.   familiar with all of the hardware in the world and I don't know how
  1137.   helpful I can be; I personally use machines with IDE and SCSI disks,
  1138.   SCSI CD-ROMs, 3Com and WD ethernet cards, serial mice, motherboards
  1139.   with PCI, NCR 810 SCSI controllers, AMD 386DX40 w/Cyrix copr., AMD
  1140.   5x86, AMD 486DX4, and Intel 486DX4 processors (This is an overview of
  1141.   what I use and am familiar with, certainly not a recommendation, but
  1142.   if you want that, you're more than welcome to ask :-) ).
  1143.  
  1144.   Version -0.1 was written on October 3, 1994; this document is
  1145.   available in SGML, PostScript, TeX, roff, and plain-text formats.
  1146.  
  1147.   13.2.  To do
  1148.  
  1149.   The ``Tips and tricks'' section is a little small. I hope to expand on
  1150.   it with suggestions from others.
  1151.   So is ``Additional packages.''
  1152.  
  1153.   More debugging/crash recovery info needed.
  1154.  
  1155.   13.3.  Contributions
  1156.  
  1157.   A small part of Linus' README (kernel hacking options) is inclusive.
  1158.   (Thanks, Linus!)
  1159.  
  1160.   uc@brian.lunetix.de (Ulrich Callmeier): patch -s and xargs.
  1161.  
  1162.   quinlan@yggdrasil.com (Daniel Quinlan): corrections and additions in
  1163.   many sections.
  1164.  
  1165.   nat@nataa.frmug.fr.net (Nat Makarevitch): mrproper, tar -p
  1166.  
  1167.   boldt@math.ucsb.edu (Axel Boldt): collected descriptions of kernel
  1168.   configuration options on the net; then provided me with the list
  1169.  
  1170.   lembark@wrkhors.psyber.com (Steve Lembark): multiple boot suggestion
  1171.  
  1172.   kbriggs@earwax.pd.uwa.edu.au (Keith Briggs): some corrections and
  1173.   suggestions
  1174.  
  1175.   rmcguire@freenet.columbus.oh.us (Ryan McGuire): makeables additions
  1176.  
  1177.   dumas@excalibur.ibp.fr (Eric Dumas): French translation
  1178.  
  1179.   simazaki@yu-gate.yamanashi.ac.jp (Yasutada Shimazaki): Japanese
  1180.   translation
  1181.  
  1182.   jjamor@lml.ls.fi.upm.es (Juan Jose Amor Iglesias): Spanish translation
  1183.  
  1184.   donahue@tiber.nist.gov (Michael J Donahue): typos, winner of the
  1185.   ``sliced bread competition''
  1186.  
  1187.   rms@gnu.ai.mit.edu (Richard Stallman): ``free'' documentation
  1188.   concept/distribution notice
  1189.  
  1190.   dak@Pool.Informatik.RWTH-Aachen.DE (David Kastrup): NFS thing
  1191.  
  1192.   The people who have sent me mail with questions and problems have also
  1193.   been quite helpful.
  1194.  
  1195.   13.4.  Copyright notice, License, and all that stuff
  1196.  
  1197.   Copyright ⌐ Brian Ward, 1994-1996.
  1198.  
  1199.   Permission is granted to make and distribute copies of this manual
  1200.   provided the copyright notice and this permission notice are preserved
  1201.   on all copies.
  1202.  
  1203.   Permission is granted to copy and distribute modified versions of this
  1204.   manual under the conditions for verbatim copying, provided that the
  1205.   derived work is distributed under the terms of a permission notice
  1206.   identical to this one. Translations fall under the catagory of
  1207.   ``modified versions.''
  1208.  
  1209.   Warranty: None.
  1210.  
  1211.   Recommendations: Commercial redistribution is allowed and encouraged;
  1212.   however, it is strongly recommended that the redistributor contact the
  1213.   author before the redistribution, in the interest of keeping things
  1214.   up-to-date (you could send me a copy of the thing you're making while
  1215.   you're at it). Translators are also advised to contact the author
  1216.   before translating. The printed version looks nicer. Recycle.
  1217.  
  1218.